<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
    <link th:href="@{/static/bootstrap/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/static/font-awesome/css/font-awesome.css}" rel="stylesheet"/>
    <script th:src="@{/static/util/js/jquery-2.1.0.js}"></script>
    <script th:src="@{/static/util/js/wangEditor.js}"></script>
    <script th:src="@{/static/bootstrap/js/bootstrap.min.js}"></script>
    <script th:src="@{/static/layer/layer.js}"></script>
</head>
<body>
<div class="container">
    <div class="row" style="margin-top: 10px">
            <input id="courseId"  type="text" name="id" th:value="${course.id}" hidden="hidden"/>
            <div id="courseText" th:utext="${course.text}">

            </div>
            <button type="button" class="btn btn-primary btn-block" >提交</button>
    </div>
</div>
<script th:inline="javascript">
    /*<![CDATA[*/
    ctxPath = /*[[@{/}]]*/ '';

    /*]]>*/
    var E = window.wangEditor
    var editor = new E('#courseText');
    editor.customConfig.uploadImgServer = ctxPath+'course/upload';
    editor.customConfig.uploadFileName = 'file';
    editor.customConfig.onblur = function (html) {
        layer.load(0,{shade:true,shade: 0});
        $.post(ctxPath+"course/editText",{id:$("#courseId").val(),text:editor.txt.html()},function (data) {
            layer.closeAll('loading');
            layer.msg(data);
        })
    };
    editor.create()


</script>
</body>
</html>